import React, { Component } from 'react'
const DetailData = [
  {
    id: '01',
    content: 'message001 content'
  },
  {
    id: '02',
    content: 'message002 content'
  },
  {
    id: '03',
    content: 'message003 content'
  }
]
export default class Detail extends Component {
  render () {
    // 接收 params 参数
    const { id, title } = this.props.match.params
    console.log(id)
    const findResult = DetailData.find(detailObj => detailObj.id === id)
    return (
      <ul>
        <li>id:{id}</li>
        <li>tltle:{title}</li>
        <li>content:{findResult.content}</li>
      </ul>
    )
  }
}
